{extend name="main"}
{block name="style"}
<style type="text/css">
	.flex-lable{width: 100px;color: #6c757d;text-align: right;padding-right: 10px;}
</style>
{/block}
{block name="body"}
<div class="container-xl py-3">
	<div class="bg-white shadow">
		<div class="flex border-bottom p-4">
			<div>
				<img src="{$Find.headimg}" width="80" height="80" class="rounded-circle">
			</div>
			<div class="flex-1 px-4 pt-3">
				<div class="flex flex-center">
					<h5 class="font-weight-bold">{$Find.name}{switch Find.sex}{case 1}<i class="el-icon-male text-primary ml-1"></i>{/case}{case 2}<i class="el-icon-female text-eda5de ml-1"></i>{/case}{default /}{/switch}</h5>
				</div>
				<div class="pt-2">{$Find.age}岁 丨 {$Find.educational_background} 丨 {$Find.work_experience_time}年工作经验</div>
				<div class="pt-2">{notempty name="Find.residence"}现居住：{$Find.residence}{/notempty}{notempty name="Find.native_place"} 丨 户籍：{$Find.native_place}{/notempty}</div>
				{notempty name="Find.specialty_label"}
				<div class="pt-2">
					{volist name="Find.specialty_label" id="v"}
					<el-tag type="primary" size="mini">{$v}</el-tag>
		    		{/volist}
				</div>
				{/notempty}
				<div class="flex pt-2">
					<div>{$Find.job_status}</div>
				</div>
			</div>
			<div class="pt-3">
				<div class="text-secondary">更新时间：{{rowData.refresh_time}}</div>
				<div class="pt-5 d-print-none">
			      	<transition>
			      		<el-button type="success" size="mini"
			      		v-if="rowData.examine==1 || rowData.examine=='loading'"
			      		@click="dialogVisible=true" 
			      		:loading="rowData.examine=='loading'">已审核</el-button>
			      		<el-button type="info" size="mini" 
			      		v-else-if="rowData.examine==0 || rowData.examine=='loading'" 
			      		@click="dialogVisible=true" 
			      		:loading="rowData.examine=='loading'">待审核</el-button>
			      		<el-button type="danger" size="mini" 
			      		v-else-if="rowData.examine==2 || rowData.examine=='loading'" 
			      		@click="dialogVisible=true" 
			      		:loading="rowData.examine=='loading'">未通过</el-button>
					</transition>
				</div>
			</div>
		</div>
		{notempty name="Find.resume_employment_intention"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="flex-1 block-title-before pb-2">求职意向</div>
			</div>
			{volist name="Find.resume_employment_intention" id="v"}
			<div class="flex py-2">
				<div class="flex flex-center">
					<div>
						<i class="el-icon-location-outline"></i>{notempty name="v.area_city"}
						<span>{$v.area_city}</span>
						{else/}
						<span>地区不限</span>
						{/notempty}
					</div>
					<div class="border-left py-1 mx-2"></div>
					<div>
						{$v.jobs_cate3}
					</div>
					{neq name="v.nature_of_work" value="1"}
					<div class="px-1">·</div>
					<div>{eq name="v.nature_of_work" value="2"}兼职{else/}实习{/eq}</div>
					{/neq}
					<div class="border-left py-1 mx-2"></div>
					<div>
						{empty name="v.industry"}
						<span>行业不限</span>
						{else/}
						<span>{$v.industry}</span>
						{/empty}
					</div>
					<div class="border-left py-1 mx-2"></div>
					<div>
						期望薪资：
						{gt name="v.salary_min" value="0"}{$v.salary_min}~{$v.salary_max}K/月{else/}面议{/gt}
					</div>
			    </div>
			</div>
			{/volist}
		</div>
		{/notempty}
		{notempty name="Find.self_description"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="flex-1 block-title-before pb-2">自我描述</div>
			</div>
			<div class="text-secondary">{$Find.self_description}</div>
		</div>
		{/notempty}
		{notempty name="Find.educational_experience"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="flex-1 block-title-before pb-2">教育经历</div>
			</div>
			<el-timeline class="pt-3">
				{volist name="Find.educational_experience" id="v"}
			    <el-timeline-item>
			    	<div>{$v.educational_background} 丨 {$v.school_name} 丨 {$v.specialities}</div>
			    	<div class="text-secondary">{$v.start_time}至{$v.end_time}</div>
			    </el-timeline-item>
			    {/volist}
			</el-timeline>
		</div>
		{/notempty}
		{notempty name="Find.work_experience"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="block-title-before pb-2">工作经历</div>
				<div class="text-primary pl-3">(TA参加工作了{$Find.work_experience_time}年，共做了{$Find.work_experience|count}份工作)</div>
			</div>
			{volist name="Find.work_experience" id="v"}
			<div class="flex pt-4 hover-show-block">
				<div class="pr-2 text-secondary">
					<i class="el-icon-office-building"></i>
				</div>
				<div class="flex-1">
					<div class="flex flex-center">
						<div>{$v.company_name} 丨 {$v.job_title}</div>
						<div class="text-secondary pl-3">{$v.start_time}-{$v.end_time}</div>
					</div>
					<div class="text-secondary pt-3 pr-5">{$v.job_content}</div>
				</div>
			</div>
		    {/volist}
		</div>
		{/notempty}
		{notempty name="Find.training_experience"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="block-title-before pb-2">培训经历</div>
			</div>
			{volist name="Find.training_experience" id="v"}
			<div class="flex pt-4">
				<div class="pr-2 text-secondary">
					<i class="el-icon-reading"></i>
				</div>
				<div class="flex-1">
					<div class="flex flex-center">
						<div>{$v.project_name} 丨 {$v.mechanism}</div>
						<div class="text-secondary pl-3">{$v.start_time}-{$v.end_time}</div>
					</div>
					<div class="text-secondary pt-3 pr-5">{$v.training_content}</div>
				</div>
			</div>
		    {/volist}
		</div>
		{/notempty}
		{notempty name="Find.project_experience"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="block-title-before pb-2">项目经历</div>
			</div>
			{volist name="Find.project_experience" id="v"}
			<div class="flex pt-4 hover-show-block">
				<div class="pr-2 text-secondary">
					<i class="el-icon-suitcase"></i>
				</div>
				<div class="flex-1">
					<div class="flex flex-center">
						<div>{$v.project_name} 丨 {$v.project_role}</div>
						<div class="text-secondary pl-3">{$v.start_time}-{$v.end_time}</div>
					</div>
					<div class="text-secondary pt-3 pr-5">{$v.project_content}</div>
					<div class="text-secondary pt-3 pr-5">{$v.project_link}</div>
				</div>
			</div>
		    {/volist}
		</div>
		{/notempty}
		{notempty name="Find.certificate"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="block-title-before pb-2">获得证书</div>
			</div>
			<div>
				{volist name="Find.certificate" id="v"}
				<el-tag type="primary" class="mb-2">{$v}</el-tag>
		    	{/volist}
			</div>
		</div>
		{/notempty}
		{notempty name="Find.language_ability"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="flex-1 block-title-before pb-2">语言能力</div>
			</div>
			<div>
				{volist name="Find.language_ability" id="v"}
				<el-tag type="primary" class="mb-2">{$v}</el-tag>
		    	{/volist}
			</div>
		</div>
		{/notempty}
		{notempty name="Find.works"}
		<div class="p-4">
			<div class="flex mb-3">
				<div class="flex-1 block-title-before pb-2">照片/作品</div>
			</div>
			<div class="row">
				<el-image
			      style="width: 180px;height: 160px;"
			      :src="v"
			      fit="cover"
			      :title="v.title"
			      :preview-src-list="Find.works"
			      v-for="(v,index) in Find.works"
			      class="col-auto"></el-image>
			</div>
		</div>
		{/notempty}
		<div class="p-2 small text-secondary text-right d-print-block d-none">
			<a href="{xycms:web name='url'}/resume/{$Find.id}.html">{xycms:web name="url"}/resume/{$Find.id}.html</a>
		</div>
	</div>
</div>
<el-dialog
  title="审核"
  :visible.sync="dialogVisible"
  width="600px"
  :before-close="cancelRefuseWinSubmit">
	<el-form :model="form" label-width="80px" :rules="rules" ref="form" size="small">
		  <el-form-item label="审核" prop="status">
		    <el-radio-group v-model="form.status">
		      <el-radio :label="1">通过</el-radio>
		      <el-radio :label="2">驳回</el-radio>
		    </el-radio-group>
		  </el-form-item>
		  <el-form-item label="驳回原因" prop="msg" v-if="form.status==2">
		    <el-input type="textarea" v-model="form.msg" class="col-12 pl-0 pr-0" :autosize="{ minRows: 4, maxRows: 20}" maxlength="200" show-word-limit></el-input>
		  </el-form-item>
		  <el-form-item label="通知" prop="notice">
		  	<el-checkbox v-model="form.notice"
		  	:true-label="1"
		  	:false-label="0">发送通知</el-checkbox>
		  	<p v-if="form.notice" class="small text-danger">当前发送通知</p>
		  </el-form-item>
	</el-form>
	<div slot="footer">
	    <el-button @click="cancelRefuseWinSubmit">取 消</el-button>
	    <el-button type="primary" @click="submitForm('form');" :loading="form.ajax">{{form.ajax?'提交中...':'提交'}}</el-button>
	</div>
</el-dialog>
{/block}
{block name="script"}
<script type="text/javascript">
	{empty name="Find"}
	var Find=[];
	{else/}
	var Find={:json_encode($Find,JSON_UNESCAPED_UNICODE)};
	{/empty}
</script>
<script type="text/javascript">
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			rowData:Find,
			dialogVisible:false,
			form:{
				ajax:false,
				status:1,
				notice:1,
				msg:''
			},
	        rules: {
	          status: [
	            { required: true, message: '请选择审核结果', trigger: 'change' },
	          ],
	          msg: [
	            { required: true, message: '请输入审核结果', trigger: 'blur' },
	          ],
	        }
		},
		watch:{
		    view:XYBase.viewWatch,
		},
		created(){
			XYBase.created(this);
		},
	    methods: {
	      	cancelRefuseWinSubmit(done){
	      		this.$refs.form&&this.$refs.form.resetFields();
	      		typeof done==='function'&&done();
				this.dialogVisible=false;
	      	},
			submitForm(formName) {
				var _this=this;
				_this.$refs[formName].validate((valid) => {
				  if (valid) {
					 _this.setResumeExamine(_this.rowData,_this.form.status);
				  } else {
					return XYBase.warning('请先把表单填写完整。');
				  }
				});
			},
			setResumeExamine(row,examine){
	    		if (row.examine=='loading') return;
				var _this=this;
	    		var oldExamine=row.examine;
	    		row.examine='loading';
				_this.form.ajax=true;
				var msg='';
				if (examine===2)msg='/'+_this.form.msg;
				$.ajax({
					url:'/resume/setResumeExamine/'+row.id+'/'+examine+msg,
					type:'get',
					data:{
						notice:_this.form.notice
					},
					dataType:'json',
					error:function(err){
						_this.form.ajax=false;
	    				row.examine=oldExamine;
			          	XYBase.error(XYBase.config.system_network_error);
					},
					success:function(ret){
						_this.form.ajax=false;
	    				row.examine=oldExamine;
						if (ret) {
							if (ret.code === 0) {
								row.examine=examine;
								row.update_time=ret.time;
								_this.cancelRefuseWinSubmit();
								XYBase.success(ret.msg);
							}else XYBase.msg(ret.msg);
						}else XYBase.error(XYBase.config.system_network_error);
					}
				})
			},
	    }
	});
</script>
{/block}